﻿using System;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.SPI;

namespace T.FAS.Runtime.SGSPI
{
    public interface IImportTaskService
    {
        /// <summary>
        /// 导入确认
        /// </summary>
        /// <returns></returns>
        Dictionary<string, object> ImportConfirm(string fileURL, bool isEnableExplainRow, List<ImportDef> importDefs);
        /// <summary>
        /// 导入
        /// </summary>
        /// <param name="cdoID"></param>
        /// <param name="importDefs"></param>
        /// <param name="script"></param>
        /// <param name="maxRows"></param>
        /// <param name="fileURL"></param>
        ImportTask ImportData(string cdoID, List<ImportDef> importDefs, string script, int maxRows, string fileURL, string dataQueryID, string fileName);
        /// <summary>
        /// 导入2.0
        /// </summary>
        /// <param name="importParam"></param>
        /// <param name="importDefs"></param>
        ImportTask ImportDataNew(ImportParam importParam, List<ImportDef> importDefs, List<ImportVariable> importVariables);
        /// <summary>
        /// 失败重试
        /// </summary>
        /// <param name="importTaskDetail"></param>
        /// <param name="importDefs"></param>
        /// <returns></returns>
        ImportTask Retry(string taskID, ImportParam importParam, List<ImportDef> importDefs, List<ImportVariable> importVariables);
        /// <summary>
        /// 下载导入模板
        /// </summary>
        /// <param name="cdoID"></param>
        /// <param name="importDefs"></param>
        Dictionary<string, string> DownloadTemplate(string cdoID, bool isEnableExplainRow, bool isEnableUniqueCol, List<ImportDef> importDefs);
        /// <summary>
        /// 查询导入任务列表
        /// </summary>
        /// <param name="cdoID"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        Dictionary<string, object> GetImportTaskList(string cdoID, Dictionary<string, string> filter);
        /// <summary>
        /// 查询导入任务明细
        /// </summary>
        /// <param name="taskID"></param>
        /// <returns></returns>
        Dictionary<string, object> GetImportTaskDetailList(string taskID, Dictionary<string, string> filter);
        /// <summary>
        /// 删除任务
        /// </summary>
        /// <param name="taskID"></param>
        /// <returns></returns>
        Dictionary<string, string> DeleteImportTask(string taskID);
        /// <summary>
        /// 清空任务
        /// </summary>
        /// <returns></returns>
        Dictionary<string, string> ClearImportTask(string cdoID);
        /// <summary>
        /// 清理任务
        /// </summary>
        /// <returns></returns>
        Dictionary<string, string> CleanTask(int days);
    }
}
